class Student < ActiveRecord::Base
  belongs_to :person, :primary_key => 'id', :foreign_key => 'id'
  has_many :student_plan_enrollments
  has_many :student_enrollments
  has_many :definite_discharges
  has_many :temporal_discharges

  validates_presence_of :registration_code, :admission_date
  validates_uniqueness_of :registration_code
  validates_associated :person

  accepts_nested_attributes_for :person, :allow_destroy => :true
end
